#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	int x, y;
	cin >> x;
	if (x < 1)cout << x << endl;
	else if (x >= 10)cout << x * 3 - 11 << endl;
	else cout << 2 * x - 1 << endl;
	return 0;
}